Extends field object with <span class="argument">obj</span>.

<div class="definition">
    set(field, obj)
</div>

<div class="arguments">
    <table>
    <tr>
        <td>field</td>
        <td><b>string</b>, name of the field</td>
    </tr>
    <tr>
        <td>obj</td>
        <td><b>object</b>, field object { name, type, required }</td>
    </tr>
    </table>
</div>

Returns boolean.

<h4>Description</h4>

This method will find and update the field object in the <a class="argument" href="w2form.fields">.fields</a> array. If you change
this array, you will need to call <a class="argument" href="w2form.refresh">.refresh()</a> method to update it on the screen. Note
that this does not change the field value, it changes the field object, which contains description of the field. In order to change
field value you need to update <a class="argument" href="w2form.records">.records</a> array and then call
<a class="argument" href="w2form.refresh">.refresh()</a> method to update it on the screen.
<div style="height: 10px"></div>

If you have form defined in the following way:
<textarea class="javascript">
let form = new w2form({
    name     : 'form',
    url      : 'server/post',
    record: {
        field_1 : 1,
        field_2 : 2
    },
    fields: [
        { field: 'field_1', type: 'text', required: true },
        { field: 'field_2', type: 'alphanumeric', required: true }
    ]
});

// update field object
w2ui.form.set('field_1', { type: 'int' });
w2ui.form.refresh();
</textarea>

After the update the field_1 becomes an integer field. You could have looped through the <a class="argument" href="w2form.fields">.fields</a> array
of the form looking for the field and extending it to achieve same results.
<br><br>

If you need to update field value, for the form same as above you can do it in the following way:

<textarea class="javascript">
// update field value
w2ui.form.record['field_1'] = 'new value';
w2ui.form.refresh();
</textarea>